import request from "../utils/request";
export const getSwiperData = () => {
    return request.get<any, swiperApiType>(`/topic/v1/know/navWap.json`)
}
export const getWaterfallData = (page:number)=>{
    return request.get<any,waterfallApiType>(`/topic/v1/find/recAuto.json?page=${page}&size=2`)
}



// 定义接口类型
interface swiperApiType {
    code: string,
    data: swiperDataType
}

interface swiperDataType {
    checkNavType: boolean,
    delNavId: string,
    navList: navListType[]
}

export interface navListType {
    id: number,
    picUrl: string,
    mainTitle: string,
    viceTitle: string,
    columnUrl: string,
    onlineType: boolean,
    vaildStartTime: number,
    vaildEndTime: number,
    rank: number
}

// 定义瀑布流接口类型
interface waterfallApiType{
    code:string,
    data:{
        hasMore:boolean
        result:any
    }
    extra:any
}
export interface waterfallListType{
    look:Object,
    topics:Array<waterfallDataType>
}
export interface waterfallDataType{
    topicId: string,
    nickname: string
    avatar: string, 
    title: string,
    subTitle: string,
    picUrl: string,
    appBanHeight: number,
    appBanWidth: number,
    readCount:number
}